package com.shanshan.manage.web.service.impl;

import com.shanshan.manage.web.domain.AGoods;
import com.shanshan.manage.web.mapper.AGoodsMapper;
import com.shanshan.manage.web.service.IAGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品Service业务层处理
 * 
 * @author zhaoShuHeng
 * @date 2023-08-30
 */
@Service
public class AGoodsServiceImpl implements IAGoodsService
{
    @Autowired
    private AGoodsMapper aGoodsMapper;

    /**
     * 查询商品
     * 
     * @param goodsId 商品主键
     * @return 商品
     */
    @Override
    public AGoods selectAGoodsByGoodsId(Long goodsId)
    {
        return aGoodsMapper.selectAGoodsByGoodsId(goodsId);
    }

    /**
     * 查询商品列表
     * 
     * @param aGoods 商品
     * @return 商品
     */
    @Override
    public List<AGoods> selectAGoodsList(AGoods aGoods)
    {
        return aGoodsMapper.selectAGoodsList(aGoods);
    }

    /**
     * 新增商品
     * 
     * @param aGoods 商品
     * @return 结果
     */
    @Override
    public int insertAGoods(AGoods aGoods)
    {
        return aGoodsMapper.insertAGoods(aGoods);
    }

    /**
     * 修改商品
     * 
     * @param aGoods 商品
     * @return 结果
     */
    @Override
    public int updateAGoods(AGoods aGoods)
    {
        return aGoodsMapper.updateAGoods(aGoods);
    }

    /**
     * 批量删除商品
     * 
     * @param goodsIds 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deleteAGoodsByGoodsIds(Long[] goodsIds)
    {
        return aGoodsMapper.deleteAGoodsByGoodsIds(goodsIds);
    }

    /**
     * 删除商品信息
     * 
     * @param goodsId 商品主键
     * @return 结果
     */
    @Override
    public int deleteAGoodsByGoodsId(Long goodsId)
    {
        return aGoodsMapper.deleteAGoodsByGoodsId(goodsId);
    }
}
